#define _SINGLE_LIST_VER3_

#define _SLIST_RET_OK_			0
#define _SLIST_RET_INVALID_PARAMS_ 	-1
#define _SLIST_RET_CTRL_FAIL_ 		-2
#define _SLIST_EQUEAL_			1
#define _SLIST_LARGER_THAN_		2
#define _SLIST_LESS_THAN_		3	
#define _SLIST_NODE_EXIST_		4
#define _SLIST_NODE_NEXIST_		5

typedef struct single_node _SNode;
typedef struct single_list *_SList;


typedef int	_SListRet;

typedef _SListRet (* SListVisitFunc)(void *data, void *arg);
typedef _SListRet (* SListCmpFunc)(void *data1, void *data2);
typedef _SListRet (* SListNodeFunc)(void *data);

//extern _SNode *create_node(void *data);
extern _SList create_list(SListCmpFunc cmp);
extern _SListRet destroy_list(_SList thiz, SListNodeFunc destroy);
extern _SListRet is_exist(_SList thiz, void *key);
//extern _SListRet insert_to_list(_SList thiz, _SNode *node);
extern _SListRet slist_append(_SList thiz, void *data);
extern _SListRet delete_node(_SList thiz, SListNodeFunc destroy, void *key);
extern _SListRet slist_foreach(_SList thiz, SListVisitFunc visit, void *ctx);
